﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;

namespace HSC
{
    class Common
    {

        public static string logFileName
        {
            get { return Path.Combine(TempDir, "Log.txt"); }
        }
 
        public static void Log(string msg)
        {
            string log = DateTime.Now.ToString() + '\t' + msg + Environment.NewLine;

            File.AppendAllText(logFileName, log);

        }

        public static void DeleteLog()
        {
            if (System.IO.File.Exists(logFileName)) 
                System.IO.File.Delete(logFileName);
        }

        public static string[] ReadLog()
        {
            return File.Exists(logFileName) ? File.ReadAllLines(logFileName) : null;
        }

        public static string TempDir
        {
            get { return Application.UserAppDataPath; }
        }

        public static string CommandDir
        {
            get { return "c:\\temp"; }
        }
    }
}
